
const crypto = require('crypto');
const hash = (type,str)=>crypto.createHash(type).update(str).digest('hex');
const md5 = (str)=>hash('md5',str);
const sha1 = (str)=>hash('sha1',str);
// const encryptPassword = (salt,password)=>md5(sha1(password)+salt)
const encryptPassword = (salt,password)=>md5(salt + 'adfdf!@%$#' + password)
const psw = '123456'
console.log('md5:',md5(psw));
console.log('sha1:',sha1(psw));
console.log('encryptPassword:',encryptPassword('1231237890',psw));
console.log('2次md5:',md5(md5(psw)));

module.exports = encryptPassword
